<?php

class Schedule_ScheduleController extends Zend_Controller_Action
{
    public function init()
    {
        /* Initialize action controller here */
    }
    public function indexAction()
    {
        // action body
    	if($this->getRequest()->isPost()){
    		$data = $this->getRequest()->getPost();
    		print_r($data);exit();
    		try{
    			$db = new schedule_Model_DbTable_DbSchedule();
    			$db->addSchedule($data);
    		}catch (Exception $e){
    			$e->getMessage();
    		}
    	}
        $frm = new Application_Form_FrmCreateSchedule();
    	$frmsche = $frm->frmSchedule();
    	$this->view->frmschedule = $frmsche;
        //disableLayout
        
    }
    public  function scheduleAction(){
    	/*$frm = new Application_Form_FrmCreateSchedule();
    	$this->view->frm_schedule= $frm->frmSchedule();*/
    	if($this->getRequest()->isPost()){
    		$data = $this->getRequest()->getPost();
    		//print_r($data);exit();
    		try{
    			$db = new Schedule_Model_DbTable_DbSchedule();
    			$db->addSchedule($data);
    		}catch (Exception $e){
    			$e->getMessage();
    		}
    	}
    	$frm = new Application_Form_FrmCreateSchedule();
    	$frmsche = $frm->frmSchedule();
    	$this->view->frmschedule = $frmsche;
    }
    public  function viewscheduleAction(){
    	/*$frm = new Application_Form_FrmCreateSchedule();
    	 $this->view->frm_schedule= $frm->frmSchedule();*/
    	$frm = new Application_Form_FrmCreateSchedule();
    	$frmsche = $frm->frmSchedule();
    	$this->view->frmschedule = $frmsche;
    }
    public function getSubjectFilterAction(){
    	if($this->getRequest()->isPost()){
    		$post=$this->getRequest()->getPost();
    		$deparment_id = $post["deparment_id"];
    		$year_id = $post["year_id"];
    		$semester_id = $post["semester_id"];
    	
    		$sql ="SELECT 
						 s.`subject_id`,
						 s.`subject_name` 
					FROM
						tbl_subject AS s
					WHERE s.`subject_name`!=''";
    		
    		if(!empty($deparment_id)){
    			$sql.=" AND s.`dpt_id`= $deparment_id";
    		}
    		if(!empty($year_id)){
    			$sql.=" AND s.`year_id` = $year_id";
    		}
    		if(!empty($semester_id)){
    			$sql.=" AND s.`semestr_id`= $semester_id";
    		}
    		$sql.=" ORDER BY s.`subject_name`";
    	
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row=$db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    }
    public function teacherMon78Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT 
					  t.`teacher_id`,
					  t.`teacher_name` 
					FROM
					  tbl_teacher AS t,
					  tbl_subject AS s,
					  tbl_teaching AS ti,
					  tb_avaliable_time_store AS ats,
					  tbl_avaliable_time_teacher AS att
					WHERE t.`teacher_id`=ti.`teacher_id`
					AND s.`subject_id`=ti.`subject_id`
					AND t.`teacher_id`=ats.`t_id`
					AND ats.`avaliable_id`=att.`avaliable_id`
					AND s.`subject_id`=$subject_id
					AND att.`mon_7_8`=1";
    			$db = new Application_Model_DbTable_DbGlobal();
    			$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    }
    
    public function teachermon810Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`mon_8_10`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    }
    
    public function teachermon1012Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`mon_10_12`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    }
    
    public function teachermon12Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`mon_1_2`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    }
    public function teachermon24Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`mon_2_4`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    }
    
    public function teachermon45Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`mon_4_5`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    }
    
    public function teachermon57Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`mon_5_7`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    }
    
    public function teachermon781Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`mon_7_8_1`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    }
    /// teacher tuesday
    public function teachertue78Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`tur_7_8`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    	}
    
    	public function teachertue810Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
	    				tbl_subject AS s,
	    				tbl_teaching AS ti,
	    				tb_avaliable_time_store AS ats,
	    				tbl_avaliable_time_teacher AS att
	    			WHERE t.`teacher_id`=ti.`teacher_id`
	    				AND s.`subject_id`=ti.`subject_id`
	    				AND t.`teacher_id`=ats.`t_id`
	    				AND ats.`avaliable_id`=att.`avaliable_id`
	    				AND s.`subject_id`=$subject_id
	    				AND att.`tur_8_10`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    		}
    		}
    
    		public function teachertue1012Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`tur_10_12`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    		}
    		}
    
    		public function teachertue12Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`tur_1_2`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    		}
    		}
    		public function teachertue24Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`tur_2_4`=1";
    			$db = new Application_Model_DbTable_DbGlobal();
    			$row = $db->getGlobalDb($sql);
    			echo Zend_Json::encode($row);
    			exit();
    		}
    		}
    
    		public function teachertue45Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`tur_4_5`=1";
    			$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    				}
    				}
    
    				public function teachertue57Action(){
    				if($this->getRequest()->IsPost()){
    				$data = $this->getRequest()->getPost();
    				$subject_id = $data["subject_id"];
    				$sql ="SELECT
			    				t.`teacher_id`,
			    				t.`teacher_name`
			    			FROM
			    				tbl_teacher AS t,
			    				tbl_subject AS s,
			    				tbl_teaching AS ti,
			    				tb_avaliable_time_store AS ats,
			    				tbl_avaliable_time_teacher AS att
			    			WHERE t.`teacher_id`=ti.`teacher_id`
			    				AND s.`subject_id`=ti.`subject_id`
			    				AND t.`teacher_id`=ats.`t_id`
			    				AND ats.`avaliable_id`=att.`avaliable_id`
			    				AND s.`subject_id`=$subject_id
			    				AND att.`tur_5_7`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    }
    }
    
    	public function teachertue781Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
			    		t.`teacher_id`,
			    		t.`teacher_name`
			    	FROM
			    		tbl_teacher AS t,
			    		tbl_subject AS s,
			    		tbl_teaching AS ti,
			    		tb_avaliable_time_store AS ats,
			    		tbl_avaliable_time_teacher AS att
			    	WHERE t.`teacher_id`=ti.`teacher_id`
			    		AND s.`subject_id`=ti.`subject_id`
			    		AND t.`teacher_id`=ats.`t_id`
			    		AND ats.`avaliable_id`=att.`avaliable_id`
			    		AND s.`subject_id`=$subject_id
			    		AND att.`tur_7_8_1`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    }
    
    public function teacherwed78Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    		AND att.`wed_7_8`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    	}
    
    	public function teacherwed810Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    				tbl_subject AS s,
    				tbl_teaching AS ti,
    				tb_avaliable_time_store AS ats,
    				tbl_avaliable_time_teacher AS att
    				WHERE t.`teacher_id`=ti.`teacher_id`
    				AND s.`subject_id`=ti.`subject_id`
    				AND t.`teacher_id`=ats.`t_id`
    				AND ats.`avaliable_id`=att.`avaliable_id`
    				AND s.`subject_id`=$subject_id
    				AND att.`wed_8_10`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    		}
    		}
    
    		public function teacherwed1012Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    		AND att.`wed_10_12`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    		}
    		}
    
    		public function teacherwed12Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    		AND att.`wed_1_2`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    		}
    		}
    		public function teacherwed24Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    			AND att.`wed_2_4`=1";
    			$db = new Application_Model_DbTable_DbGlobal();
    			$row = $db->getGlobalDb($sql);
    			echo Zend_Json::encode($row);
    			exit();
    		}
    		}
    
    		public function teacherwed45Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    			AND att.`wed_4_5`=1";
    			$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    				}
    				}
    
    				public function teacherwed57Action(){
    				if($this->getRequest()->IsPost()){
    				$data = $this->getRequest()->getPost();
    				$subject_id = $data["subject_id"];
    				$sql ="SELECT
    				t.`teacher_id`,
    				t.`teacher_name`
    				FROM
    				tbl_teacher AS t,
    				tbl_subject AS s,
    				tbl_teaching AS ti,
    				tb_avaliable_time_store AS ats,
    				tbl_avaliable_time_teacher AS att
    				WHERE t.`teacher_id`=ti.`teacher_id`
    				AND s.`subject_id`=ti.`subject_id`
    				AND t.`teacher_id`=ats.`t_id`
    				AND ats.`avaliable_id`=att.`avaliable_id`
    				AND s.`subject_id`=$subject_id
    				AND att.`wed_5_7`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    }
    }
    
    	public function teacherwed781Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    		AND att.`wed_7_8_1`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    	}
    
    	public function teacherthu78Action(){
    		if($this->getRequest()->IsPost()){
    			$data = $this->getRequest()->getPost();
    			$subject_id = $data["subject_id"];
    			$sql ="SELECT
    			t.`teacher_id`,
    			t.`teacher_name`
    			FROM
    			tbl_teacher AS t,
    			tbl_subject AS s,
    			tbl_teaching AS ti,
    			tb_avaliable_time_store AS ats,
    			tbl_avaliable_time_teacher AS att
    			WHERE t.`teacher_id`=ti.`teacher_id`
    			AND s.`subject_id`=ti.`subject_id`
    			AND t.`teacher_id`=ats.`t_id`
    			AND ats.`avaliable_id`=att.`avaliable_id`
    			AND s.`subject_id`=$subject_id
    			AND att.`thu_7_8`=1";
    			$db = new Application_Model_DbTable_DbGlobal();
    			$row = $db->getGlobalDb($sql);
    			echo Zend_Json::encode($row);
    			exit();
    		}
    		}
    	
    		public function teacherthu810Action(){
    		if($this->getRequest()->IsPost()){
    			$data = $this->getRequest()->getPost();
    			$subject_id = $data["subject_id"];
    			$sql ="SELECT
    			t.`teacher_id`,
    			t.`teacher_name`
    			FROM
    			tbl_teacher AS t,
    					tbl_subject AS s,
    					tbl_teaching AS ti,
    					tb_avaliable_time_store AS ats,
    					tbl_avaliable_time_teacher AS att
    					WHERE t.`teacher_id`=ti.`teacher_id`
    					AND s.`subject_id`=ti.`subject_id`
    					AND t.`teacher_id`=ats.`t_id`
    					AND ats.`avaliable_id`=att.`avaliable_id`
    					AND s.`subject_id`=$subject_id
    					AND att.`thu_8_10`=1";
    					$db = new Application_Model_DbTable_DbGlobal();
    					$row = $db->getGlobalDb($sql);
    					echo Zend_Json::encode($row);
    					exit();
    			}
    			}
    	
    			public function teacherthu1012Action(){
    			if($this->getRequest()->IsPost()){
    			$data = $this->getRequest()->getPost();
    			$subject_id = $data["subject_id"];
    			$sql ="SELECT
    			t.`teacher_id`,
    			t.`teacher_name`
    			FROM
    			tbl_teacher AS t,
    			tbl_subject AS s,
    			tbl_teaching AS ti,
    			tb_avaliable_time_store AS ats,
    			tbl_avaliable_time_teacher AS att
    			WHERE t.`teacher_id`=ti.`teacher_id`
    			AND s.`subject_id`=ti.`subject_id`
    			AND t.`teacher_id`=ats.`t_id`
    			AND ats.`avaliable_id`=att.`avaliable_id`
    			AND s.`subject_id`=$subject_id
    			AND att.`thu_10_12`=1";
    			$db = new Application_Model_DbTable_DbGlobal();
    			$row = $db->getGlobalDb($sql);
    			echo Zend_Json::encode($row);
    			exit();
    			}
    			}
    	
    			public function teacherthu12Action(){
    			if($this->getRequest()->IsPost()){
    			$data = $this->getRequest()->getPost();
    			$subject_id = $data["subject_id"];
    			$sql ="SELECT
    			t.`teacher_id`,
    			t.`teacher_name`
    			FROM
    			tbl_teacher AS t,
    			tbl_subject AS s,
    			tbl_teaching AS ti,
    			tb_avaliable_time_store AS ats,
    			tbl_avaliable_time_teacher AS att
    			WHERE t.`teacher_id`=ti.`teacher_id`
    			AND s.`subject_id`=ti.`subject_id`
    			AND t.`teacher_id`=ats.`t_id`
    			AND ats.`avaliable_id`=att.`avaliable_id`
    			AND s.`subject_id`=$subject_id
    			AND att.`thu_1_2`=1";
    			$db = new Application_Model_DbTable_DbGlobal();
    			$row = $db->getGlobalDb($sql);
    			echo Zend_Json::encode($row);
    			exit();
    			}
    			}
    			public function teacherthu24Action(){
    			if($this->getRequest()->IsPost()){
    			$data = $this->getRequest()->getPost();
    			$subject_id = $data["subject_id"];
    			$sql ="SELECT
    			t.`teacher_id`,
    			t.`teacher_name`
    			FROM
    			tbl_teacher AS t,
    			tbl_subject AS s,
    			tbl_teaching AS ti,
    			tb_avaliable_time_store AS ats,
    			tbl_avaliable_time_teacher AS att
    			WHERE t.`teacher_id`=ti.`teacher_id`
    			AND s.`subject_id`=ti.`subject_id`
    			AND t.`teacher_id`=ats.`t_id`
    			AND ats.`avaliable_id`=att.`avaliable_id`
    			AND s.`subject_id`=$subject_id
    				AND att.`thu_2_4`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    			}
    			}
    	
    			public function teacherthu45Action(){
    			if($this->getRequest()->IsPost()){
    			$data = $this->getRequest()->getPost();
    			$subject_id = $data["subject_id"];
    			$sql ="SELECT
    			t.`teacher_id`,
    			t.`teacher_name`
    			FROM
    			tbl_teacher AS t,
    			tbl_subject AS s,
    			tbl_teaching AS ti,
    			tb_avaliable_time_store AS ats,
    			tbl_avaliable_time_teacher AS att
    			WHERE t.`teacher_id`=ti.`teacher_id`
    			AND s.`subject_id`=ti.`subject_id`
    			AND t.`teacher_id`=ats.`t_id`
    			AND ats.`avaliable_id`=att.`avaliable_id`
    			AND s.`subject_id`=$subject_id
    				AND att.`thu_4_5`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    					$row = $db->getGlobalDb($sql);
    					echo Zend_Json::encode($row);
    					exit();
    					}
    					}
    	
    					public function teacherthu57Action(){
    					if($this->getRequest()->IsPost()){
    					$data = $this->getRequest()->getPost();
    					$subject_id = $data["subject_id"];
    					$sql ="SELECT
    					t.`teacher_id`,
    					t.`teacher_name`
    					FROM
    					tbl_teacher AS t,
    					tbl_subject AS s,
    					tbl_teaching AS ti,
    					tb_avaliable_time_store AS ats,
    					tbl_avaliable_time_teacher AS att
    					WHERE t.`teacher_id`=ti.`teacher_id`
    					AND s.`subject_id`=ti.`subject_id`
    					AND t.`teacher_id`=ats.`t_id`
    					AND ats.`avaliable_id`=att.`avaliable_id`
    					AND s.`subject_id`=$subject_id
    					AND att.`thu_5_7`=1";
    					$db = new Application_Model_DbTable_DbGlobal();
    					$row = $db->getGlobalDb($sql);
    					echo Zend_Json::encode($row);
    					exit();
    	}
    	}
    	
    		public function teacherthu781Action(){
    			if($this->getRequest()->IsPost()){
    			$data = $this->getRequest()->getPost();
    			$subject_id = $data["subject_id"];
    			$sql ="SELECT
    			t.`teacher_id`,
    			t.`teacher_name`
    			FROM
    			tbl_teacher AS t,
    			tbl_subject AS s,
    			tbl_teaching AS ti,
    			tb_avaliable_time_store AS ats,
    			tbl_avaliable_time_teacher AS att
    			WHERE t.`teacher_id`=ti.`teacher_id`
    			AND s.`subject_id`=ti.`subject_id`
    			AND t.`teacher_id`=ats.`t_id`
    			AND ats.`avaliable_id`=att.`avaliable_id`
    			AND s.`subject_id`=$subject_id
    			AND att.`thu_7_8_1`=1";
    			$db = new Application_Model_DbTable_DbGlobal();
    			$row = $db->getGlobalDb($sql);
    			echo Zend_Json::encode($row);
    			exit();
    		}
    		}
    		
   
    		public function teacherfri78Action(){
    			if($this->getRequest()->IsPost()){
    				$data = $this->getRequest()->getPost();
    				$subject_id = $data["subject_id"];
    				$sql ="SELECT
    				t.`teacher_id`,
    				t.`teacher_name`
    				FROM
    				tbl_teacher AS t,
    				tbl_subject AS s,
    				tbl_teaching AS ti,
    				tb_avaliable_time_store AS ats,
    				tbl_avaliable_time_teacher AS att
    				WHERE t.`teacher_id`=ti.`teacher_id`
    				AND s.`subject_id`=ti.`subject_id`
    				AND t.`teacher_id`=ats.`t_id`
    				AND ats.`avaliable_id`=att.`avaliable_id`
    				AND s.`subject_id`=$subject_id
    				AND att.`fri_7_8`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    			}
    			}
    		
    			public function teacherfri810Action(){
    			if($this->getRequest()->IsPost()){
    				$data = $this->getRequest()->getPost();
    				$subject_id = $data["subject_id"];
    				$sql ="SELECT
    				t.`teacher_id`,
    				t.`teacher_name`
    				FROM
    				tbl_teacher AS t,
    						tbl_subject AS s,
    						tbl_teaching AS ti,
    						tb_avaliable_time_store AS ats,
    						tbl_avaliable_time_teacher AS att
    						WHERE t.`teacher_id`=ti.`teacher_id`
    						AND s.`subject_id`=ti.`subject_id`
    						AND t.`teacher_id`=ats.`t_id`
    						AND ats.`avaliable_id`=att.`avaliable_id`
    						AND s.`subject_id`=$subject_id
    						AND att.`fri_8_10`=1";
    						$db = new Application_Model_DbTable_DbGlobal();
    						$row = $db->getGlobalDb($sql);
    						echo Zend_Json::encode($row);
    						exit();
    				}
    				}
    		
    				public function teacherfri1012Action(){
    				if($this->getRequest()->IsPost()){
    				$data = $this->getRequest()->getPost();
    				$subject_id = $data["subject_id"];
    				$sql ="SELECT
    				t.`teacher_id`,
    				t.`teacher_name`
    				FROM
    				tbl_teacher AS t,
    				tbl_subject AS s,
    				tbl_teaching AS ti,
    				tb_avaliable_time_store AS ats,
    				tbl_avaliable_time_teacher AS att
    				WHERE t.`teacher_id`=ti.`teacher_id`
    				AND s.`subject_id`=ti.`subject_id`
    				AND t.`teacher_id`=ats.`t_id`
    				AND ats.`avaliable_id`=att.`avaliable_id`
    				AND s.`subject_id`=$subject_id
    				AND att.`fri_10_12`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    				}
    				}
    		
    				public function teacherfri12Action(){
    				if($this->getRequest()->IsPost()){
    				$data = $this->getRequest()->getPost();
    				$subject_id = $data["subject_id"];
    				$sql ="SELECT
    				t.`teacher_id`,
    				t.`teacher_name`
    				FROM
    				tbl_teacher AS t,
    				tbl_subject AS s,
    				tbl_teaching AS ti,
    				tb_avaliable_time_store AS ats,
    				tbl_avaliable_time_teacher AS att
    				WHERE t.`teacher_id`=ti.`teacher_id`
    				AND s.`subject_id`=ti.`subject_id`
    				AND t.`teacher_id`=ats.`t_id`
    				AND ats.`avaliable_id`=att.`avaliable_id`
    				AND s.`subject_id`=$subject_id
    				AND att.`fri_1_2`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    				}
    				}
    				public function teacherfri24Action(){
    				if($this->getRequest()->IsPost()){
    				$data = $this->getRequest()->getPost();
    				$subject_id = $data["subject_id"];
    				$sql ="SELECT
    				t.`teacher_id`,
    				t.`teacher_name`
    				FROM
    				tbl_teacher AS t,
    				tbl_subject AS s,
    				tbl_teaching AS ti,
    				tb_avaliable_time_store AS ats,
    				tbl_avaliable_time_teacher AS att
    				WHERE t.`teacher_id`=ti.`teacher_id`
    				AND s.`subject_id`=ti.`subject_id`
    				AND t.`teacher_id`=ats.`t_id`
    				AND ats.`avaliable_id`=att.`avaliable_id`
    				AND s.`subject_id`=$subject_id
    					AND att.`fri_2_4`=1";
    					$db = new Application_Model_DbTable_DbGlobal();
    					$row = $db->getGlobalDb($sql);
    					echo Zend_Json::encode($row);
    					exit();
    				}
    				}
    		
    				public function teacherfri45Action(){
    				if($this->getRequest()->IsPost()){
    				$data = $this->getRequest()->getPost();
    				$subject_id = $data["subject_id"];
    				$sql ="SELECT
    				t.`teacher_id`,
    				t.`teacher_name`
    				FROM
    				tbl_teacher AS t,
    				tbl_subject AS s,
    				tbl_teaching AS ti,
    				tb_avaliable_time_store AS ats,
    				tbl_avaliable_time_teacher AS att
    				WHERE t.`teacher_id`=ti.`teacher_id`
    				AND s.`subject_id`=ti.`subject_id`
    				AND t.`teacher_id`=ats.`t_id`
    				AND ats.`avaliable_id`=att.`avaliable_id`
    				AND s.`subject_id`=$subject_id
    					AND att.`fri_4_5`=1";
    					$db = new Application_Model_DbTable_DbGlobal();
    						$row = $db->getGlobalDb($sql);
    						echo Zend_Json::encode($row);
    						exit();
    						}
    						}
    		
    						public function teacherfri57Action(){
    						if($this->getRequest()->IsPost()){
    						$data = $this->getRequest()->getPost();
    						$subject_id = $data["subject_id"];
    						$sql ="SELECT
    						t.`teacher_id`,
    						t.`teacher_name`
    						FROM
    						tbl_teacher AS t,
    						tbl_subject AS s,
    						tbl_teaching AS ti,
    						tb_avaliable_time_store AS ats,
    						tbl_avaliable_time_teacher AS att
    						WHERE t.`teacher_id`=ti.`teacher_id`
    						AND s.`subject_id`=ti.`subject_id`
    						AND t.`teacher_id`=ats.`t_id`
    						AND ats.`avaliable_id`=att.`avaliable_id`
    						AND s.`subject_id`=$subject_id
    						AND att.`fri_5_7`=1";
    						$db = new Application_Model_DbTable_DbGlobal();
    						$row = $db->getGlobalDb($sql);
    						echo Zend_Json::encode($row);
    						exit();
    		}
    		}
    		
    			public function teacherfri781Action(){
    				if($this->getRequest()->IsPost()){
    				$data = $this->getRequest()->getPost();
    				$subject_id = $data["subject_id"];
    				$sql ="SELECT
    				t.`teacher_id`,
    				t.`teacher_name`
    				FROM
    				tbl_teacher AS t,
    				tbl_subject AS s,
    				tbl_teaching AS ti,
    				tb_avaliable_time_store AS ats,
    				tbl_avaliable_time_teacher AS att
    				WHERE t.`teacher_id`=ti.`teacher_id`
    				AND s.`subject_id`=ti.`subject_id`
    				AND t.`teacher_id`=ats.`t_id`
    				AND ats.`avaliable_id`=att.`avaliable_id`
    				AND s.`subject_id`=$subject_id
    				AND att.`fri_7_8_1`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    			}
    }
    
    public function teachersat78Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    		AND att.`sat_7_8`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
    	}
    
    	public function teachersat810Action(){
    	if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    				tbl_subject AS s,
    				tbl_teaching AS ti,
    				tb_avaliable_time_store AS ats,
    				tbl_avaliable_time_teacher AS att
    				WHERE t.`teacher_id`=ti.`teacher_id`
    				AND s.`subject_id`=ti.`subject_id`
    				AND t.`teacher_id`=ats.`t_id`
    				AND ats.`avaliable_id`=att.`avaliable_id`
    				AND s.`subject_id`=$subject_id
    				AND att.`sat_8_10`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    		}
    		}
    
    		public function teachersat1012Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    		AND att.`sat_10_12`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    		}
    		}
    
    		public function teachersat12Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    		AND att.`sat_1_2`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    		}
    		}
    		public function teachersat24Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    			AND att.`sat_2_4`=1";
    			$db = new Application_Model_DbTable_DbGlobal();
    			$row = $db->getGlobalDb($sql);
    			echo Zend_Json::encode($row);
    			exit();
    		}
    		}
    
    		public function teachersat45Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    			AND att.`sat_4_5`=1";
    			$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    				}
    				}
    
    				public function teachersat57Action(){
    				if($this->getRequest()->IsPost()){
    				$data = $this->getRequest()->getPost();
    				$subject_id = $data["subject_id"];
    				$sql ="SELECT
    				t.`teacher_id`,
    				t.`teacher_name`
    				FROM
    				tbl_teacher AS t,
    				tbl_subject AS s,
    				tbl_teaching AS ti,
    				tb_avaliable_time_store AS ats,
    				tbl_avaliable_time_teacher AS att
    				WHERE t.`teacher_id`=ti.`teacher_id`
    				AND s.`subject_id`=ti.`subject_id`
    				AND t.`teacher_id`=ats.`t_id`
    				AND ats.`avaliable_id`=att.`avaliable_id`
    				AND s.`subject_id`=$subject_id
    				AND att.`sat_5_7`=1";
    				$db = new Application_Model_DbTable_DbGlobal();
    				$row = $db->getGlobalDb($sql);
    				echo Zend_Json::encode($row);
    				exit();
    }
    }
    
    	public function teachersat781Action(){
    		if($this->getRequest()->IsPost()){
    		$data = $this->getRequest()->getPost();
    		$subject_id = $data["subject_id"];
    		$sql ="SELECT
    		t.`teacher_id`,
    		t.`teacher_name`
    		FROM
    		tbl_teacher AS t,
    		tbl_subject AS s,
    		tbl_teaching AS ti,
    		tb_avaliable_time_store AS ats,
    		tbl_avaliable_time_teacher AS att
    		WHERE t.`teacher_id`=ti.`teacher_id`
    		AND s.`subject_id`=ti.`subject_id`
    		AND t.`teacher_id`=ats.`t_id`
    		AND ats.`avaliable_id`=att.`avaliable_id`
    		AND s.`subject_id`=$subject_id
    		AND att.`sat_7_8_1`=1";
    		$db = new Application_Model_DbTable_DbGlobal();
    		$row = $db->getGlobalDb($sql);
    		echo Zend_Json::encode($row);
    		exit();
    	}
   }
   
   public function teachersun78Action(){
   	if($this->getRequest()->IsPost()){
   		$data = $this->getRequest()->getPost();
   		$subject_id = $data["subject_id"];
   		$sql ="SELECT
   		t.`teacher_id`,
   		t.`teacher_name`
   		FROM
   		tbl_teacher AS t,
   		tbl_subject AS s,
   		tbl_teaching AS ti,
   		tb_avaliable_time_store AS ats,
   		tbl_avaliable_time_teacher AS att
   		WHERE t.`teacher_id`=ti.`teacher_id`
   		AND s.`subject_id`=ti.`subject_id`
   		AND t.`teacher_id`=ats.`t_id`
   		AND ats.`avaliable_id`=att.`avaliable_id`
   		AND s.`subject_id`=$subject_id
   		AND att.`sun_7_8`=1";
   		$db = new Application_Model_DbTable_DbGlobal();
   		$row = $db->getGlobalDb($sql);
   		echo Zend_Json::encode($row);
   		exit();
   	}
   	}
   
   	public function teachersun810Action(){
   	if($this->getRequest()->IsPost()){
   		$data = $this->getRequest()->getPost();
   		$subject_id = $data["subject_id"];
   		$sql ="SELECT
   		t.`teacher_id`,
   		t.`teacher_name`
   		FROM
   		tbl_teacher AS t,
   				tbl_subject AS s,
   				tbl_teaching AS ti,
   				tb_avaliable_time_store AS ats,
   				tbl_avaliable_time_teacher AS att
   				WHERE t.`teacher_id`=ti.`teacher_id`
   				AND s.`subject_id`=ti.`subject_id`
   				AND t.`teacher_id`=ats.`t_id`
   				AND ats.`avaliable_id`=att.`avaliable_id`
   				AND s.`subject_id`=$subject_id
   				AND att.`sun_8_10`=1";
   				$db = new Application_Model_DbTable_DbGlobal();
   				$row = $db->getGlobalDb($sql);
   				echo Zend_Json::encode($row);
   				exit();
   		}
   		}
   
   		public function teachersun1012Action(){
   		if($this->getRequest()->IsPost()){
   		$data = $this->getRequest()->getPost();
   		$subject_id = $data["subject_id"];
   		$sql ="SELECT
   		t.`teacher_id`,
   		t.`teacher_name`
   		FROM
   		tbl_teacher AS t,
   		tbl_subject AS s,
   		tbl_teaching AS ti,
   		tb_avaliable_time_store AS ats,
   		tbl_avaliable_time_teacher AS att
   		WHERE t.`teacher_id`=ti.`teacher_id`
   		AND s.`subject_id`=ti.`subject_id`
   		AND t.`teacher_id`=ats.`t_id`
   		AND ats.`avaliable_id`=att.`avaliable_id`
   		AND s.`subject_id`=$subject_id
   		AND att.`sun_10_12`=1";
   		$db = new Application_Model_DbTable_DbGlobal();
   		$row = $db->getGlobalDb($sql);
   		echo Zend_Json::encode($row);
   		exit();
   		}
   		}
   
   		public function teachersun12Action(){
   		if($this->getRequest()->IsPost()){
   		$data = $this->getRequest()->getPost();
   		$subject_id = $data["subject_id"];
   		$sql ="SELECT
   		t.`teacher_id`,
   		t.`teacher_name`
   		FROM
   		tbl_teacher AS t,
   		tbl_subject AS s,
   		tbl_teaching AS ti,
   		tb_avaliable_time_store AS ats,
   		tbl_avaliable_time_teacher AS att
   		WHERE t.`teacher_id`=ti.`teacher_id`
   		AND s.`subject_id`=ti.`subject_id`
   		AND t.`teacher_id`=ats.`t_id`
   		AND ats.`avaliable_id`=att.`avaliable_id`
   		AND s.`subject_id`=$subject_id
   		AND att.`sun_1_2`=1";
   		$db = new Application_Model_DbTable_DbGlobal();
   		$row = $db->getGlobalDb($sql);
   		echo Zend_Json::encode($row);
   		exit();
   		}
   		}
   		public function teachersun24Action(){
   		if($this->getRequest()->IsPost()){
   		$data = $this->getRequest()->getPost();
   		$subject_id = $data["subject_id"];
   		$sql ="SELECT
   		t.`teacher_id`,
   		t.`teacher_name`
   		FROM
   		tbl_teacher AS t,
   		tbl_subject AS s,
   		tbl_teaching AS ti,
   		tb_avaliable_time_store AS ats,
   		tbl_avaliable_time_teacher AS att
   		WHERE t.`teacher_id`=ti.`teacher_id`
   		AND s.`subject_id`=ti.`subject_id`
   		AND t.`teacher_id`=ats.`t_id`
   		AND ats.`avaliable_id`=att.`avaliable_id`
   		AND s.`subject_id`=$subject_id
   			AND att.`sun_2_4`=1";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   		}
   
   		public function teachersun45Action(){
   		if($this->getRequest()->IsPost()){
   		$data = $this->getRequest()->getPost();
   		$subject_id = $data["subject_id"];
   		$sql ="SELECT
   		t.`teacher_id`,
   		t.`teacher_name`
   		FROM
   		tbl_teacher AS t,
   		tbl_subject AS s,
   		tbl_teaching AS ti,
   		tb_avaliable_time_store AS ats,
   		tbl_avaliable_time_teacher AS att
   		WHERE t.`teacher_id`=ti.`teacher_id`
   		AND s.`subject_id`=ti.`subject_id`
   		AND t.`teacher_id`=ats.`t_id`
   		AND ats.`avaliable_id`=att.`avaliable_id`
   		AND s.`subject_id`=$subject_id
   			AND att.`sun_4_5`=1";
   			$db = new Application_Model_DbTable_DbGlobal();
   				$row = $db->getGlobalDb($sql);
   				echo Zend_Json::encode($row);
   				exit();
   				}
   				}
   
   				public function teachersun57Action(){
   				if($this->getRequest()->IsPost()){
   				$data = $this->getRequest()->getPost();
   				$subject_id = $data["subject_id"];
   				$sql ="SELECT
   				t.`teacher_id`,
   				t.`teacher_name`
   				FROM
   				tbl_teacher AS t,
   				tbl_subject AS s,
   				tbl_teaching AS ti,
   				tb_avaliable_time_store AS ats,
   				tbl_avaliable_time_teacher AS att
   				WHERE t.`teacher_id`=ti.`teacher_id`
   				AND s.`subject_id`=ti.`subject_id`
   				AND t.`teacher_id`=ats.`t_id`
   				AND ats.`avaliable_id`=att.`avaliable_id`
   				AND s.`subject_id`=$subject_id
   				AND att.`sun_5_7`=1";
   				$db = new Application_Model_DbTable_DbGlobal();
   				$row = $db->getGlobalDb($sql);
   				echo Zend_Json::encode($row);
   				exit();
   }
   }
   
   	public function teachersun781Action(){
   		if($this->getRequest()->IsPost()){
   		$data = $this->getRequest()->getPost();
   		$subject_id = $data["subject_id"];
   		$sql ="SELECT
   		t.`teacher_id`,
   		t.`teacher_name`
   		FROM
   		tbl_teacher AS t,
   		tbl_subject AS s,
   		tbl_teaching AS ti,
   		tb_avaliable_time_store AS ats,
   		tbl_avaliable_time_teacher AS att
   		WHERE t.`teacher_id`=ti.`teacher_id`
   		AND s.`subject_id`=ti.`subject_id`
   		AND t.`teacher_id`=ats.`t_id`
   		AND ats.`avaliable_id`=att.`avaliable_id`
   		AND s.`subject_id`=$subject_id
   		AND att.`sun_7_8_1`=1";
   		$db = new Application_Model_DbTable_DbGlobal();
   		$row = $db->getGlobalDb($sql);
   		echo Zend_Json::encode($row);
   		exit();
   	}
   	}
   	//***********************************************Teacher filter***************************************************
   	
   	public function teacherExistMon78FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_mon_7_8 = $data["teacher_mon_7_8"];
   			$sql ="SELECT
			   			t.`teacher_id`,
			   			t.`teacher_name`
			   		FROM
			   			tbl_teacher AS t,
			   			tbl_teacher_sche AS ts,
			   			tbl_schedules AS s
			   		WHERE t.`teacher_id` = ts.`mon_7_8`
			   			AND ts.`sche_id` = s.`schedule_id`
			   			AND t.`teacher_id` = $teacher_mon_7_8 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistTue78FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_tue_7_8 = $data["teacher_tue_7_8"];
   			$sql ="SELECT
			   			t.`teacher_id`,
			   			t.`teacher_name`
			   		FROM
			   			tbl_teacher AS t,
			   			tbl_teacher_sche AS ts,
			   			tbl_schedules AS s
			   		WHERE t.`teacher_id` = ts.`tur_7_8`
			   			AND ts.`sche_id` = s.`schedule_id`
			   			AND t.`teacher_id` = $teacher_tue_7_8 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistWed78FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_wed_7_8 = $data["teacher_wed_7_8"];
   			$sql ="SELECT
			   			t.`teacher_id`,
			   			t.`teacher_name`
			   		FROM
			   			tbl_teacher AS t,
			   			tbl_teacher_sche AS ts,
			   			tbl_schedules AS s
			   		WHERE t.`teacher_id` = ts.`wed_7_8`
			   			AND ts.`sche_id` = s.`schedule_id`
			   			AND t.`teacher_id` = $teacher_wed_7_8 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistThu78FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_thu_7_8 = $data["teacher_thu_7_8"];
   			$sql ="SELECT
			   			t.`teacher_id`,
			   			t.`teacher_name`
			   		FROM
			   			tbl_teacher AS t,
			   			tbl_teacher_sche AS ts,
			   			tbl_schedules AS s
			   		WHERE t.`teacher_id` = ts.`thu_7_8`
			   			AND ts.`sche_id` = s.`schedule_id`
			   			AND t.`teacher_id` = $teacher_thu_7_8 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistFri78FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_fri_7_8 = $data["teacher_fri_7_8"];
   			$sql ="SELECT
			   			t.`teacher_id`,
			   			t.`teacher_name`
			   		FROM
			   			tbl_teacher AS t,
			   			tbl_teacher_sche AS ts,
			   			tbl_schedules AS s
			   		WHERE t.`teacher_id` = ts.`fri_7_8`
			   			AND ts.`sche_id` = s.`schedule_id`
			   			AND t.`teacher_id` = $teacher_fri_7_8 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistSat78FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sat_7_8 = $data["teacher_sat_7_8"];
   			$sql ="SELECT
			   			t.`teacher_id`,
			   			t.`teacher_name`
			   		FROM
			   			tbl_teacher AS t,
			   			tbl_teacher_sche AS ts,
			   			tbl_schedules AS s
			   		WHERE t.`teacher_id` = ts.`sat_7_8`
			   			AND ts.`sche_id` = s.`schedule_id`
			   			AND t.`teacher_id` = $teacher_sat_7_8 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistSun78FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sun_7_8 = $data["teacher_sun_7_8"];
   			$sql ="SELECT
			   			t.`teacher_id`,
			   			t.`teacher_name`
			   		FROM
			   			tbl_teacher AS t,
			   			tbl_teacher_sche AS ts,
			   			tbl_schedules AS s
			   		WHERE t.`teacher_id` = ts.`sun_7_8`
			   			AND ts.`sche_id` = s.`schedule_id`
			   			AND t.`teacher_id` = $teacher_sun_7_8 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	//***********810************
   	 
   	public function teacherExistMon810FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_mon_8_10 = $data["teacher_mon_8_10"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`mon_8_10`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_mon_8_10 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistTue810FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_tue_8_10 = $data["teacher_tue_8_10"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`tur_8_10`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_tue_8_10 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistWed810FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_wed_8_10 = $data["teacher_wed_8_10"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`wed_8_10`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_wed_8_10 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistThu810FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_thu_8_10 = $data["teacher_thu_8_10"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`thu_8_10`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_thu_8_10 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistFri810FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_fri_8_10 = $data["teacher_fri_8_10"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`fri_8_10`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_fri_8_10 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistSat810FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sat_8_10 = $data["teacher_sat_8_10"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sat_8_10`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sat_8_10 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistSun810FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sun_8_10 = $data["teacher_sun_8_10"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sun_8_10`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sun_8_10 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	//*****************************1012**********************8
   	
   	public function teacherExistMon1012FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_mon_10_12 = $data["teacher_mon_10_12"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`mon_10_12`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_mon_10_12 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistTue1012FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_tue_10_12 = $data["teacher_tue_10_12"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`tur_10_12`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_tue_10_12 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistWed1012FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_wed_10_12 = $data["teacher_wed_10_12"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`wed_10_12`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_wed_10_12 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistThu1012FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_thu_10_12 = $data["teacher_thu_10_12"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`thu_10_12`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_thu_10_12 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistFri1012FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_fri_10_12 = $data["teacher_fri_10_12"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`fri_10_12`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_fri_10_12 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistSat1012FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sat_10_12 = $data["teacher_sat_10_12"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sat_10_12`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sat_10_12 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistSun1012FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sun_10_12 = $data["teacher_sun_10_12"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sun_10_12`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sun_10_12 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	//*************************************12************************************
   	public function teacherExistMon12FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_mon_1_2 = $data["teacher_mon_1_2"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`mon_1_2`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_mon_1_2 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistTue12FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_tue_1_2 = $data["teacher_tue_1_2"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`tur_1_2`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_tue_1_2 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistWed12FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_wed_1_2 = $data["teacher_wed_1_2"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`wed_1_2`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_wed_1_2 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistThu12FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_thu_1_2 = $data["teacher_thu_1_2"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`thu_1_2`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_thu_1_2 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistFri12FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_fri_1_2 = $data["teacher_fri_1_2"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`fri_1_2`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_fri_1_2 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistSat12FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sat_1_2 = $data["teacher_sat_1_2"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sat_1_2`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sat_1_2 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistSun12FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sun_1_2 = $data["teacher_sun_1_2"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sun_1_2`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sun_1_2 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	//*************************************24******************************************************************
   	public function teacherExistMon24FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_mon_2_4 = $data["teacher_mon_2_4"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`mon_2_4`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_mon_2_4 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistTue24FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_tue_2_4 = $data["teacher_tue_2_4"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`tur_2_4`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_tue_2_4 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistWed24FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_wed_2_4 = $data["teacher_wed_2_4"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`wed_2_4`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_wed_2_4 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistThu24FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_thu_2_4 = $data["teacher_thu_2_4"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`thu_2_4`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_thu_2_4 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistFri24FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_fri_2_4 = $data["teacher_fri_2_4"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`fri_2_4`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_fri_2_4 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistSat24FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sat_2_4 = $data["teacher_sat_2_4"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sat_2_4`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sat_2_4 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistSun24FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sun_2_4 = $data["teacher_sun_2_4"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sun_2_4`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sun_2_4 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	//****************************45***************************
   	public function teacherExistMon45FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_mon_4_5 = $data["teacher_mon_4_5"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`mon_4_5`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_mon_4_5 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistTue45FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_tue_4_5 = $data["teacher_tue_4_5"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`tur_4_5`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_tue_4_5 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistWed45FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_wed_4_5 = $data["teacher_wed_4_5"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`wed_4_5`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_wed_4_5 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistThu45FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_thu_4_5 = $data["teacher_thu_4_5"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`thu_4_5`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_thu_4_5 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistFri45FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_fri_4_5 = $data["teacher_fri_4_5"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`fri_4_5`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_fri_4_5 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistSat45FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sat_4_5 = $data["teacher_sat_4_5"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sat_4_5`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sat_4_5 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistSun45FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sun_4_5 = $data["teacher_sun_4_5"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sun_4_5`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sun_4_5 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	//*******************************************57***********************************
   	public function teacherExistMon57FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_mon_5_7 = $data["teacher_mon_5_7"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`mon_5_7`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_mon_5_7 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistTue57FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_tue_5_7 = $data["teacher_tue_5_7"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`tur_5_7`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_tue_5_7 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistWed57FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_wed_5_7 = $data["teacher_wed_5_7"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`wed_5_7`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_wed_5_7 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistThu57FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_thu_5_7 = $data["teacher_thu_5_7"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`thu_5_7`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_thu_5_7 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistFri57FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_fri_5_7 = $data["teacher_fri_5_7"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`fri_5_7`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_fri_5_7 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistSat57FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sat_5_7 = $data["teacher_sat_5_7"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sat_5_7`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sat_5_7 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistSun57FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sun_5_7 = $data["teacher_sun_5_7"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sun_5_7`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sun_5_7 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	//*************************************************************781************************
   	
   	public function teacherExistMon781FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_mon_7_8_1 = $data["teacher_mon_7_8_1"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`mon_7_8_1`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_mon_7_8_1 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistTue781FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_tue_7_8_1 = $data["teacher_tue_7_8_1"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`tur_7_8_1`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_tue_7_8_1 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistWed781FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_wed_7_8_1 = $data["teacher_wed_7_8_1"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`wed_7_8_1`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_wed_7_8_1 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistThu781FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_thu_7_8_1 = $data["teacher_thu_7_8_1"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`thu_7_8_1`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_thu_7_8_1 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistFri781FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_fri_7_8_1 = $data["teacher_fri_7_8_1"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`fri_7_8_1`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_fri_7_8_1 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	
   	public function teacherExistSat781FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sat_7_8_1 = $data["teacher_sat_7_8_1"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sat_7_8_1`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sat_7_8_1 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
   	public function teacherExistSun781FilterAction(){
   		if($this->getRequest()->IsPost()){
   			$data = $this->getRequest()->getPost();
   			$teacher_sun_7_8_1 = $data["teacher_sun_7_8_1"];
   			$sql ="SELECT
   			t.`teacher_id`,
   			t.`teacher_name`
   			FROM
   			tbl_teacher AS t,
   			tbl_teacher_sche AS ts,
   			tbl_schedules AS s
   			WHERE t.`teacher_id` = ts.`sun_7_8_1`
   			AND ts.`sche_id` = s.`schedule_id`
   			AND t.`teacher_id` = $teacher_sun_7_8_1 ";
   			$db = new Application_Model_DbTable_DbGlobal();
   			$row = $db->getGlobalDb($sql);
   			echo Zend_Json::encode($row);
   			exit();
   		}
   	}
}